FROM alpine:3.13.6

COPY smbuser.sh /usr/bin/smbuser.sh
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add samba supervisor && \
mkdir /etc/supervisor.d/ && \
chmod +x /usr/bin/smbuser.sh
COPY samba-server.ini /etc/supervisor.d/samba-server.ini
VOLUME [ "/etc/samba", "/var/samba-user-files" ]
EXPOSE 139/tcp
EXPOSE 445/tcp
EXPOSE 137/udp

CMD ["/usr/bin/supervisord","--nodaemon"]
